package com.zpark.jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.IOException;

/**
 * @PackageName: com.zpark.jsoup
 * @ClassName: JsoupPrintImages
 * @Description:
 * @author: RZS
 * @date: 2021/8/16  9:59
 */
public class JsoupPrintImages {
    public static void main( String[] args ) throws IOException {
        Document doc = Jsoup.connect("https://y.qq.com").get();
        Elements images = doc.select("img[src~=(?i)\\.(png|jpe?g|gif)]");
        for (Element image : images) {
            System.out.println("src : " + image.attr("src"));
            System.out.println("height : " + image.attr("height"));
            System.out.println("width : " + image.attr("width"));
            System.out.println("alt : " + image.attr("alt"));
        }
    }
}
